/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryRecipientPlace;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryRecipientPlaceSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryRecipientPlace record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_recipient_place");

                if (record.getRecipientProvinceCode() != null) {
                    VALUES("recipient_province_code", "#{recipientProvinceCode,jdbcType=VARCHAR}");
                }

                if (record.getRecipientProvinceName() != null) {
                    VALUES("recipient_province_name", "#{recipientProvinceName,jdbcType=VARCHAR}");
                }

                if (record.getRecipientCityCode() != null) {
                    VALUES("recipient_city_code", "#{recipientCityCode,jdbcType=VARCHAR}");
                }

                if (record.getRecipientCityName() != null) {
                    VALUES("recipient_city_name", "#{recipientCityName,jdbcType=VARCHAR}");
                }

                if (record.getRecipientDistrictCode() != null) {
                    VALUES("recipient_district_code", "#{recipientDistrictCode,jdbcType=VARCHAR}");
                }

                if (record.getRecipientDistrictName() != null) {
                    VALUES("recipient_district_name", "#{recipientDistrictName,jdbcType=VARCHAR}");
                }

                if (record.getCreateUser() != null) {
                    VALUES("create_user", "#{createUser,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    VALUES("upd_user", "#{updUser,jdbcType=INTEGER}");
                }

                if (record.getUpdTime() != null) {
                    VALUES("upd_time", "#{updTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryRecipientPlace record) {
        return new SQL() {
            {
                UPDATE("delivery_recipient_place");

                if (record.getRecipientProvinceCode() != null) {
                    SET("recipient_province_code = #{recipientProvinceCode,jdbcType=VARCHAR}");
                }

                if (record.getRecipientProvinceName() != null) {
                    SET("recipient_province_name = #{recipientProvinceName,jdbcType=VARCHAR}");
                }

                if (record.getRecipientCityCode() != null) {
                    SET("recipient_city_code = #{recipientCityCode,jdbcType=VARCHAR}");
                }

                if (record.getRecipientCityName() != null) {
                    SET("recipient_city_name = #{recipientCityName,jdbcType=VARCHAR}");
                }

                if (record.getRecipientDistrictCode() != null) {
                    SET("recipient_district_code = #{recipientDistrictCode,jdbcType=VARCHAR}");
                }

                if (record.getRecipientDistrictName() != null) {
                    SET("recipient_district_name = #{recipientDistrictName,jdbcType=VARCHAR}");
                }

                if (record.getCreateUser() != null) {
                    SET("create_user = #{createUser,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    SET("upd_user = #{updUser,jdbcType=INTEGER}");
                }

                if (record.getUpdTime() != null) {
                    SET("upd_time = #{updTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}